package com.mspbots.core.ticketai.model;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.JsonNode;
import com.mspbots.core.typehandler.JsonNodeTypeHandler;
import com.mspbots.core.wise.model.TenantEntity;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;

import java.util.List;

/**
 * com.mspbots.core.ticketai.TicketGradeInfo
 *
 * @author Alex bob(https://github.com/vnobo)
 * @date Created by 2019/8/20
 */
@Data
@Builder
@AllArgsConstructor
@TableName(value = "tenant_ticket_rules", autoResultMap = true)
public class TicketRule extends TenantEntity {

    private Integer board;
    private String name;
    private String displayName;
    private Boolean enable;

    @TableField(typeHandler = JsonNodeTypeHandler.class)
    private JsonNode params;

    @TableField(exist = false)
    private List<Integer> applyToBoards;

    @TableField(exist = false)
    private String boardName;


    public TicketRule() {
    }

    public TicketRule(Long tenantId, String name) {
        super.tenantId = tenantId;
        this.name = name;
    }
}
